$(document).ready(function(){
    $(function(){
        $(".search-box input").focus(function(){
            $(this).parent('div').css('border','2px solid #F5C63E');
        }).blur(function(){
            $(this).parent('div').css('border','2px solid #C0C0C0');
        });
    });
    $(function(){
        $(".state li").click(function(){
            $(this).addClass('active').siblings('li').removeClass('active');
        })
    });
    $(function(){
        $("table tbody tr td s").on('click',function(){
            $(this).toggleClass('selected');
        })
    });
    $(".status").on("click",function(){
        $(this).addClass("on").siblings().removeClass("on");
    });
});

/**
 * 商品详情
 */
function productDetail(id){
	window.location.href = "/DistributorSystem/product/findProductInfo?id="+id;
}

/**
 * 删除商品
 */
function productDelete(id){
	alert("id"+id)
	$.messager.confirm('确认','您确认想要删除记录吗？',function(r){    
	    if (r){    
	    	$.ajax({
	    		type:"POST",
	    		async:false,
	    		url:"/DistributorSystem/product/deleteProductById",
	    		data:{id:id},
	    		success:function(result){
	    			console.log(result);
	    		},
	    		error:function(result){
	    			console.log(result);
	    		}
	    	});
	    }    
	});  
	/*$.ajax({
		type:"POST",
		async:false,
		url:"/DistributorSystem/product/deleteProductById",
		data:{id:id},
		success:function(result){
			console.log(result);
		},
		error:function(result){
			console.log(result);
		}
	});*/
    
}